package example.spring_aop.controller;

import example.spring_aop.config.MyAspect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description  学习自定义注解
 * @Author ZJX
 * @Date 2024/9/2 19:16
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @MyAspect
    @RequestMapping("/u1")
    public String u1(){
        log.info("执行t1方法...");
        return "u1";
    }

    @RequestMapping("/u2")
    public String u2(){
        log.info("执行t2方法...");
        int a = 10/0;
        return "u2";
    }
}
